<!--#include File="Config/Config.asp"-->
<!--#include File="Include/Class_Function.asp"-->
<!--#include File="Include/Class_FrontPage.asp"-->
<%
action	=	trim(request("action"))
if action = "save" then
	title		=	ReplaceBadChar(request("title"))
	content	=	ReplaceBadChar(request("gcontent"))
	username=	ReplaceBadChar(request("username"))
	LinkPhone	=	ReplaceBadChar(request("linkphone"))
	companyname	=	ReplaceBadChar(request("companyname"))
	address			=	ReplaceBadChar(request("address"))
	email			=	ReplaceBadChar(request("email"))
	sqlstr = "insert into GuestBook (GuestbookTitle,UserName,LinkPhone,CompanyName,Address,Email,GuestbookContent) values ('"&title&"','"&UserName&"','"&LinkPhone&"','"&CompanyName&"','"&Address&"','"&Email&"','"&content&"')"
	conn.execute(sqlstr)
	response.Write "<script>alert('提交留言成功！');window.location.href='guestbook.asp';</script>"
end if

title	=	"留言反馈"	'页面title
NavParent	=	1
call showhead()		'-----显示头部导航
%>
  <div id="content">
    <div class="left">
		<%call showleft()%>
    </div>
    <div class="right">
      <div class="banner"><a href="http://www.zhujianqiang.com" target="_blank"><img src="images/banner.jpg" width="675" height="100" border="0" alt="<%=SiteName%>"/></a></div>
      <div class="indexcontent">
        <div class="about">
          <div class="linetitle"><%=Title%></div>
          <div class="contacts">
<script language="javascript" type="text/javascript">
function saveguestbook()
{
	var username	=	document.getElementById("username").value;
	if (username=="")
	{
		alert("请填写您的姓名！");	
		document.getElementById("username").focus();
		return false
	}
	var linkphone	=	document.getElementById("linkphone").value;
	if (linkphone=="")
	{
		alert("请填写您的联系电话！");	
		document.getElementById("linkphone").focus();
		return false
	}
	var companyname	=	document.getElementById("companyname").value;
	if (companyname=="")
	{
		alert("请填写您的公司电话！");	
		document.getElementById("companyname").focus();
		return false
	}
	var address	=	document.getElementById("address").value;
	if (address=="")
	{
		alert("请填写您的地址！");	
		document.getElementById("address").focus();
		return false
	}	
	var email	=	document.getElementById("email").value;
	if (email=="")
	{
		alert("请填写您的邮箱！");	
		document.getElementById("email").focus();
		return false
	}	
	var title	=	document.getElementById("title").value;
	if (title=="")
	{
		alert("请填写您的留言主题！");	
		document.getElementById("title").focus();
		return false
	}	
	var gcontent	=	document.getElementById("gcontent").value;
	if (gcontent=="")
	{
		alert("请填写您的留言内容！");	
		document.getElementById("gcontent").focus();
		return false
	}	
	document.getElementById("form1").action="?action=save";
	document.getElementById("form1").submit();
}
</script>
<form id="form1" name="form1" method="post" action="?action=save">
  <table width="500" border="0" align="center" cellpadding="1" cellspacing="1">
    <tr>
      <td width="113" align="right">用户名：</td>
      <td width="380"><input type="text" name="username" id="username" /></td>
    </tr>
    <tr>
      <td align="right">电话：</td>
      <td><input type="text" name="linkphone" id="linkphone" /></td>
    </tr>
    <tr>
      <td align="right">公司名称：</td>
      <td><input type="text" name="companyname" id="companyname" /></td>
    </tr>
    <tr>
      <td align="right">地址：</td>
      <td><input type="text" name="address" id="address" /></td>
    </tr>
    <tr>
      <td align="right">邮箱：</td>
      <td><input type="text" name="email" id="email" /></td>
    </tr>
    <tr>
      <td align="right">主题：</td>
      <td><input type="text" name="title" id="title" /></td>
    </tr>
    <tr>
      <td align="right">内容：</td>
      <td><textarea name="gcontent" cols="40" rows="5" id="gcontent"></textarea></td>
    </tr>
    <tr>
      <td colspan="2" align="center"><input type="button" name="button" id="button" onClick="javascript:saveguestbook();" value="提交留言" />
      <input type="reset" name="button2" id="button2" value="重置" /></td>
    </tr>
  </table>
</form>	           
          </div>
        </div>
        <div class="clear"></div>
      </div>
    </div>
  </div>
<%
'------显示页面尾部--
call showfoot()
%>